only block/unblock completion->priv->insert_text_id if it is actually
authorMichael Natterer <mitch@imendio.com>
Fri, 26 Jan 2007 11:39:16 +0000 (11:39 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Fri, 26 Jan 2007 11:39:16 +0000 (11:39 +0000)
2007-01-26  Michael Natterer  <mitch@imendio.com>

* gtk/gtkentrycompletion.c (gtk_entry_completion_insert_prefix):
only block/unblock completion->priv->insert_text_id if it is
actually connected. While this can't happen the way GtkEntry
itself uses the completion, it's still public API and should not
blindly call functions that will spit warnings (fix taken from
maemo-gtk).

svn path=/trunk/; revision=17215

ChangeLog
gtk/gtkentrycompletion.c

index 24c368dc7b7f38f6a1cc3f5549831c11add28760..eb27a334835f0431f8348ec6d61ea5870a054781 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-01-26  Michael Natterer  <mitch@imendio.com>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_insert_prefix):
+       only block/unblock completion->priv->insert_text_id if it is
+       actually connected. While this can't happen the way GtkEntry
+       itself uses the completion, it's still public API and should not
+       blindly call functions that will spit warnings (fix taken from
+       maemo-gtk).
+
 2007-01-25  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk/gdkwindow.c: Reduce locking overhead by not repeatedly getting
index 474b65764fb3a46ce9821e1b3ad5c1fbf3541477..ba1a644c1be1a7c5e19f440fd29db90b9473a67a 100644 (file)
@@ -1568,8 +1568,10 @@ gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion)
   gboolean done;
   gchar *prefix;
 
-  g_signal_handler_block (completion->priv->entry,
-                         completion->priv->insert_text_id);
+  if (completion->priv->insert_text_id > 0)
+    g_signal_handler_block (completion->priv->entry,
+                            completion->priv->insert_text_id);
+
   prefix = gtk_entry_completion_compute_prefix (completion);
   if (prefix)
     {
@@ -1577,8 +1579,10 @@ gtk_entry_completion_insert_prefix (GtkEntryCompletion *completion)
                     0, prefix, &done);
       g_free (prefix);
     }
-  g_signal_handler_unblock (completion->priv->entry,
-                           completion->priv->insert_text_id);
+
+  if (completion->priv->insert_text_id > 0)
+    g_signal_handler_unblock (completion->priv->entry,
+                              completion->priv->insert_text_id);
 }
 
 /**